// -*- c++ -*-
// item.h: define all kinds of items, such as Food, Equipment, Book
//     Author: WuChen (jiqingwu@gmail.com)
//     Create: 2012-08-30
//     Update: 2012-09-10

#ifndef __ITEM_H__
#define __ITEM_H__

#include "TextParser.h"

class CItem {
public:
    char szName[32];	//物品名称
    char szDesc[256];	//物品描述
    short nCost;		//值多少钱
public:
    void ShowName();
    virtual void ShowDetail();
    virtual bool Load(CTextParser &file) = 0;
};

class CFood : public CItem
{	
public:
    short nAddHP;		//增加Hp
    short nAddMaxHP;	//增加max HP
    short nAddMP;		//增加Mp
    short nAddMaxMP;	//增加max MP
    virtual void ShowDetail();
    virtual bool Load(CTextParser &file);
};


class CEquipment : public CItem
{
public:
    enum Location {
        HEAD = 0,
        BODY = 1,
        HAND = 2,
        FOOT = 3
    };

    short nLocation;	//可以装备的位置。0-头，1-身，2-手，3-脚
    short nAddAttack;	//增加攻击
    short nAddDefence;	//增加防御
    short nAddSpeed;	//增加速度
    virtual void ShowDetail();
    virtual bool Load(CTextParser &file);
};

class CBook : public CItem
{
public:
    short nSkillIndex;	//技能书对应的技能
    virtual void ShowDetail();
    virtual bool Load(CTextParser &file);
};


#endif
